layers=2;
temp=[]
tic
for ind=1:layers
    ids = getStimIDs2(aux_data,frame_times(ind:layers:end),'stimfile',...
        'D:\RawData\leinmarc\AW_130418_rbs\S1-T9586_stim.mat');
    maps = calcPixelMaps(data{ind},'stim_on',ids.stim_on,'lowpass',0);
    avg = reshape(repmat(template{ind}(:),[1 3]),[size(template{ind}) 3]);
    avg = single(scaleImage(avg))/65536;
    temp(:,:,:,(ind)*2-1) = maps.ori_ratio_HLS_hc;
    temp(:,:,:,(ind)*2) = avg;
    toc
end
figure
montage(temp,'Size',[layers 2]);
